package com.itheima02;

import java.math.BigDecimal;

public class Work02 {
    public static void main(String[] args) {
        Student s1 = new Student("张三", "男", 20, 79.5);
        Student s2 = new Student("李四", "女", 21, 80.2);
        Student s3 = new Student("王五", "男", 22, 77.9);
        Student s4 = new Student("周六", "男", 20, 55.8);
        Student s5 = new Student("赵七", "女", 21, 99.9);
        double sum = s1.getNum() + s2.getNum() + s3.getNum() + s4.getNum() + s5.getNum();
        BigDecimal b1 = new BigDecimal(sum);
        BigDecimal b2 = new BigDecimal(5);


        BigDecimal b3 = b1.divide(b2, 2, BigDecimal.ROUND_HALF_DOWN);
        System.out.println("平均值为: " + b3);
    }
}
